#pragma once

template<class Node>
inline bool compareNodes(const Node * left, const Node * right)
{
	// Compare children count
    if(left->getChildrenCount() != right->getChildrenCount())
    	return false;

    // Compare node types
    if(left->getNodeType() != right->getNodeType())
        return false;

    // Compare children
    for(size_t i=0; i < left->getChildrenCount(); ++i)
    {
        // Compare i-th children
        Node * leftChild = left->getChild(i);
        Node * rightChild = right->getChild(i);

		if(!leftChild->compare(rightChild))
			return false;
    }

    return true;
}

